﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClassLibrary.DAL;

namespace ClassLibrary.BLL
{
    public class BLLDonHang
    {
        private int id;
        public int ID
        {
            get { return id; }
            set { id = value; }
        }
        private string madh;
        public string MaDH
        {
            get { return madh; }
            set { madh = value; }
        }
        private string tendh;
        public string TenDH
        {
            get { return tendh; }
            set { tendh = value; }
        }
        private DateTime ngayxuat;
        public DateTime NgayXuat
        {
            get { return ngayxuat; }
            set { ngayxuat = value; }
        }
        private decimal tongtien;
        public decimal TongTien
        {
            get { return tongtien; }
            set { tongtien = value; }
        }
        private int idkhach;
        public int IDKhach
        {
            get { return idkhach; }
            set { idkhach = value; }
        }
        private List<BLLChiTietDH> chitiet;
        public List<BLLChiTietDH> ChiTiet
        {
            get { return chitiet; }
            set { chitiet = value; }
        }
        private  List<BLLKhachHang> khachhang;
        public List<BLLKhachHang> KhachHang
        {
            get { return khachhang; }
            set { khachhang = value; }
        }
        public BLLDonHang()
        { }
        public BLLDonHang(int _id,int _idkhach)
        {
            ID = _id;
            IDKhach = _idkhach;
        }
        public BLLDonHang(int _id,string _madh,string _tendh,DateTime _ngayxuat,decimal _tongtien,int _idkhach)
        {
            ID = _id;
            MaDH = _madh;
            TenDH = _tendh;
            NgayXuat = _ngayxuat;
            TongTien = _tongtien;
            IDKhach = _idkhach;
        }
        public BLLDonHang(int _id, string _madh, string _tendh, DateTime _ngayxuat, decimal _tongtien, int _idkhach,List<BLLKhachHang> _khachhang)
        {
            ID = _id;
            MaDH = _madh;
            TenDH = _tendh;
            NgayXuat = _ngayxuat;
            TongTien = _tongtien;
            IDKhach = _idkhach;
            KhachHang = _khachhang;
         
        }
        public List<BLLDonHang> GetAll()
        {
            return DALDonHang.GetAll();
        }
        public List<BLLDonHang> GetChiTiet()
        {
            return DALDonHang.GetChiTietDH(this);
        }
       
    }
}
